package org.budo.graph.service.util;

import java.awt.GraphicsEnvironment;

import org.springframework.context.ApplicationContext;

/**
 * @author lmw
 */
public class AvailableFontsUtil {
    public static String writeAvailableFontsResponse(ApplicationContext applicationContext, String url) {
        GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
        String[] availableFontFamilyNames = graphicsEnvironment.getAvailableFontFamilyNames();
        String result = "<ol>";

        for (String fontFamilyName : availableFontFamilyNames) {
            result += "<li>" + fontFamilyName + "</li>";
        }
        result += "</ol>";

        return result;
    }
}
